#地图可视化的基本使用
from pyecharts.charts import Map
from pyecharts.options import VisualMapOpts

#准备地图对象
map1=Map()

#准备数据
data=[
    ("上海市",20),
    ("北京市",3),
    ("台湾省",9),
    ("吉林省",90),
    ("山东省",400)
]
#添加数据
map1.add("测试地图",data,"china")
#设置全局选项
map1.set_global_opts(
    visualmap_opts=VisualMapOpts(
        is_show=True,
        is_piecewise=True,
        pieces=[
            {"min":1,"max":9,"label":"1-9","color":"#CCFFFF"},
            {"min":10,"max":99,"label":"10-99","color":"#FF6666"},
            {"min":100,"max":499,"label":"100-499","color":"#668885"}
        ]
    )
)
#绘图
map1.render()
